import json
import sys
import requests


def func(data):
	return data["data"]["idTwoZ"]

if __name__ == '__main__':
	# 从外面拿到参数
	jsonStr = sys.argv[1]
	varStd = json.loads(json.loads(jsonStr))
	# 参数构建
	result = {"apiName": "身份证二要素验证", "secret": "ab19ce53b6a34a2499d93ed71d8a3097", "shortName": "br"}
	result["name"] = varStd["name"]
	result["id"] = varStd["id"]
	# 参数json化
	str = json.dumps(result)
	# 调用数据网关接口 得到结果
	host = 'https://dcode-test.cguarantee.com/service-interface-gateway/api/invoke/'
	header_dict = {
		'Content-Type': 'application/json; charset=utf8',
		'User-Agent': 'PostmanRuntime/7.29.2',
		'Connection': 'close'
	}
	rsp = requests.post(host, data=str, headers=header_dict, timeout=None )
	# 请求完成后 关闭连接
	json_data = ''
	if (rsp.ok):
		json_data = rsp.json()
	print(func(json_data))
	rsp.close()
